package multiple_status;

class Graph {
    public void draw() {
        System.out.println("graph draw");
    }

    public Graph() {
        System.out.println("graph init start");
        draw();
        System.out.println("graph init end");
    }
}

class Cycle extends Graph {
    private int radius = 1;
    public Cycle(int radius) {
        System.out.println("cycle init print1. radius = " + this.radius);
        this.radius = radius;
        System.out.println("cycle init print2. radius = " + this.radius);
    }

    @Override
    public void draw() {
        System.out.println("cycle draw print. radius = " + radius);
    }
}

/**
 * 构造器中调用多态方法
 */
public class Test2 {
    public static void main(String[] args) {
        new Cycle(5);
    }
}
